var orderNumber=getvl("id");

$(function(){
	 if(orderNumber!=""){
	 	querenquxiao();
	 }else{
	 	alert("异常");
	 }
});
function  querenquxiao(){
   	  $.ajax({
      url: urlcore+"/api/refundOrder/selectOneDetails?orderid="+orderNumber,
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
				if(data.success == true) {
					var da=data.data;
					if(da!=null){
					
				$("#xiugaituikuan").attr("href","12.9.2buy_dingdan_tuikuan_shenqing.html?ids="+da.id);					
	              var refundTypes="";
	             // alert(JSON.stringify(data.data))
	              if(da.refundType=="1"){
	              	  refundTypes="退款退货";
	              }else if(da.refundType=="2"){ 
	              	  refundTypes="仅退款";
	              }else{
	              	alert("未识别")
	              }
	              
	              $("#leixing").html(refundTypes);
	              
	              $("#yuanyin").html(da.refundReason);
	              $("#jine").html(da.refundMoney);
	              $("#tuikuanshuoming").html(da.refundRemark);
	              $("#bianhao").html(da.order.orderNumber);
	              var gmtDatetime = new Date(da.gmtDatetime).pattern("yyyy-MM-dd hh:mm");
	              $("#shijian").html(gmtDatetime);
				}else{
					alert("异常");
				}
				}
				
			},
			error: function() {
				alert("error");
			}
		});
}




function  quere(){
	
            if(orderNumber!=""){
            	 $.ajax({
      url: urlcore+"/api/order/cancelOrder?id="+orderNumber,
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success: function(data) {
				if(data.success == true) {
				   window.location.href = document.referrer;
				}
			},
			error: function() {
				alert("error");
			}
		});
            }
   	 
}

